package com.mengshu.token.utils;

import com.mengshu.token.consts.TokenConsts;
import org.springframework.web.context.request.NativeWebRequest;

import javax.servlet.http.HttpServletRequest;

public class RequestUtils {

    public static String getToken(HttpServletRequest request) {
        return request.getHeader(TokenConsts.REQUEST_HEAD_TOKEN);
    }

    public static String getToken(NativeWebRequest request) {
        return request.getHeader(TokenConsts.REQUEST_HEAD_TOKEN);
    }

    public static String getPlatform(HttpServletRequest request) {
        return request.getHeader(TokenConsts.REQUEST_HEAD_PLATFORM);
    }
}
